package daily.aug0813;

import java.io.File;

public class Exercise_TraverseMoreDir {
    public static void main(String[] args) {
        File file01 = new File("D:\\Download\\Windows\\Theme");
        printAllFiles(file01);
    }

    private static void printAllFiles(File file) {
        File[] filesList = file.listFiles();
        //遍历filesList
        for (File f : filesList){
            System.out.println(f);
            //如果此时遍历到的f是目录，则递归调用printAllFiles方法，遍历子目录
            if(f.isDirectory()){
                printAllFiles(f);
            }
        }
    }
}
